<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('Cate/index')}">{:lang('墓区类型')}</a></li>
			<li><a href="{:url('Cate/add')}">{:lang('ADD_CATE')}</a></li>
		</ul>
		<div>
			<form  class="well form-search" action="{:url('Cate/index')}" method="post">
				<label>{:lang('墓区类型')}:
					<input type="text" name="cate_name" placeholder="请输入墓区类型"value="{:input('request.cate_name')}" class="form-control"> </label>
				<input type="submit" class="btn btn-primary" value="搜索" />
				<a class="btn btn-danger" href="{:url('Cate/index')}">清空</a>
			</form>
		</div>
		<form action="{:url('Cate/listorders')}" method="post">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>{:lang('CATE_NAME')}</th>
						<th>{:lang('CREAT_TIME')}</th>
						<th>{:lang('SORT_ORDER')}</th>
						<th>{:lang('IF_SHOW')}</th>
						<th>{:lang('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="results" item="cate">
						<tr>
							<td>{$cate.cate_name}</td>
							<td><php>echo date('Y-m-d H:i:s', $cate['add_time'])</php></td>
							<td>{$cate.sort_order}</td>
							<td>
								<if condition="$cate['if_show'] eq 1">
									<font color="red">√</font>
								<else />
									<font color="red">╳</font>
								</if>
							</td>
							<td>
								<a href="{:url('Cate/edit',array('id'=>$cate['id'],'mark'=>$cate['mark']))}">{:lang('EDIT')}</a>
								|
								<a href="{:url('Cate/catedelete',array('id'=>$cate['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
								|
								<a class="js-ajax-delete" data-msg="确定更改状态吗？"
									href="{:url('Cate/toggle',array('id'=>$cate['id'],'show'=>$cate['if_show']))}">{:lang('TOGGLE')}</a>
								|
								<a href="{:url('Cate/add',array('id'=>$cate['id'],'mark'=>$cate['mark']))}">{:lang('ADD_CHILD')}</a>
							</td>
						</tr>
						<foreach name="cate['sub']" item="vo">
							<tr>
								<td>&nbsp;&nbsp;&nbsp;<if condition="count($cate['sub']) eq ($key+1)">└─<else />├─</if>&nbsp;{$vo.cate_name}</td>
								<td><php>echo date('Y-m-d H:i:s', $vo['add_time'])</php></td>
								<td>{$vo.sort_order}</td>
								<td>
									<if condition="$vo['if_show'] eq 1">
										<font color="red">√</font>
									<else />
										<font color="red">╳</font>
									</if>
								</td>
								<td>
									<a href="{:url('Cate/edit',array('id'=>$vo['id'],'mark'=>$vo['mark']))}">{:lang('EDIT')}</a>
									|
									<a href="{:url('Cate/catedelete',array('id'=>$vo['id'],))}" class="js-ajax-delete">{:lang('DELETE')}</a>
									|
									<a class="js-ajax-delete" data-msg="确定更改状态吗？"
										href="{:url('Cate/toggle',array('id'=>$vo['id'],'show'=>$vo['if_show']))}">{:lang('TOGGLE')}</a>
								</td>
							</tr>
						</foreach>
					</foreach>
				</tbody>
			</table>
			<div class="pagination" style="margin-top: -10px">{$page}</div>
		</form>
	</div>
	<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>

</body>
</html>